﻿using System.Collections.Generic;

namespace GerbilLib
{
    /// <summary>
    /// Set of title cleaning options used to manipulate how MediaGerbil cleans
    /// title strings. Typically stored in a Preferences object.
    /// </summary>
    public class TitleCleaningOptions
    {
        /// <summary>
        /// Gets or sets the ignore patterns.
        /// </summary>
        /// <value>
        /// The ignore patterns.
        /// </value>
        public HashSet<string> IgnorePatterns { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether to strip the year from the title.
        /// </summary>
        /// <value>
        ///   <c>true</c> to strip the year from the title; otherwise, <c>false</c>.
        /// </value>
        public bool StripYearFromTitle { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether to replace periods with spaces.
        /// </summary>
        /// <value>
        /// 	<c>true</c> to replace periods with spaces; otherwise, <c>false</c>.
        /// </value>
        public bool ReplacePeriodsWithSpaces { get; set; }
        /// <summary>
        /// Gets or sets a value indicating whether to remove brackets.
        /// </summary>
        /// <value>
        ///   <c>true</c> to remove brackets; otherwise, <c>false</c>.
        /// </value>
        public bool RemoveBrackets { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="TitleCleaningOptions"/> class.
        /// </summary>
        public TitleCleaningOptions()
        {
            // Needed for XmlSerializer
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="TitleCleaningOptions"/> class.
        /// </summary>
        /// <param name="ignorePatterns">The ignore patterns.</param>
        /// <param name="stripYearFromTitle">if set to <c>true</c> strip year from title.</param>
        /// <param name="replacePeriodsWithSpaces">if set to <c>true</c> replace periods with spaces.</param>
        /// <param name="removeBrackets">if set to <c>true</c> remove brackets.</param>
        public TitleCleaningOptions(HashSet<string> ignorePatterns = null, bool stripYearFromTitle = false, bool replacePeriodsWithSpaces = true, bool removeBrackets = false)
            : this()
        {
            IgnorePatterns = ignorePatterns;
            StripYearFromTitle = stripYearFromTitle;
            ReplacePeriodsWithSpaces = replacePeriodsWithSpaces;
            RemoveBrackets = removeBrackets;
        }
    }
}
